package com.ljchen.formalProject.frame.exceptions;


import com.ljchen.formalProject.enums.ResultCode;
import lombok.Getter;

@Getter
public class APIException extends RuntimeException {

    private String message;

    private ResultCode resultCode;

    public APIException() {
        this(ResultCode.ERROR);
    }

    public APIException(String message) {
        this(message, ResultCode.ERROR);
    }

    public APIException(ResultCode resultCode) {
        this(resultCode.getMessage(), resultCode);
    }

    public APIException(String message, ResultCode resultCode) {
        super(message);
        this.message = message;
        this.resultCode = resultCode;
    }

    public APIException(ResultCode resultCode, String message) {
        super(message);
        this.message = message;
        this.resultCode = resultCode;
    }
}
